package com.yyk.yykywd.mvvm.adapter

import android.content.Context
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yyk.yykywd.AGENT
import com.yyk.yykywd.R
import com.yyk.yykywd.mvvm.entity.HomeBean
import com.yyk.yykywd.mvvm.entity.ReturnMoney
import com.yyk.yykywd.util.GlideUtils

/**
 * 文件描述：
 * Created by guo on 2019-11-19.
 */
class DynamicBroadCastAdapter(private val context: Context,
                              layoutResId: Int,
                              data: List<HomeBean.Data.Report>) : BaseQuickAdapter<HomeBean.Data.Report, BaseViewHolder>(layoutResId, data) {
    override fun convert(helper: BaseViewHolder, item: HomeBean.Data.Report) {
        helper.setText(R.id.tv_time, item.createtime)
        helper.setText(R.id.tv_name, item.name)
        helper.setText(R.id.tv_content, item.state)
        val tvTime: TextView = helper.getView(R.id.tv_time)
        if (item.flag == 1) {
            tvTime.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_yy,0,0,0)
        } else {
            tvTime.setCompoundDrawablesWithIntrinsicBounds(R.drawable.icon_dls,0,0,0)
        }
    }

}